package com.xcl.ui;

import java.awt.EventQueue;
import java.awt.List;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

import com.xcl.dao.imp.logDao;

public class log extends JFrame {
//	List loglist=new List();
	private JFrame frame;
	private JTextField number;
	private JTextField password;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
//		final logDao logdao=new logDao();
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					
					log window = new log();
					
					window.frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
		
	}

	/**
	 * Create the application.
	 */
	public log() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		
		frame = new JFrame();
		frame.setBounds(100, 100, 1000, 700);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(null);
		
		number = new JTextField();
		number.setBounds(315, 409, 420, 58);
		frame.getContentPane().add(number);
		number.setColumns(10);
		
		password = new JTextField();
		password.setBounds(314, 485, 421, 58);
		frame.getContentPane().add(password);
		password.setColumns(10);
		
		JButton button = new JButton("登录");
		button.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseClicked(MouseEvent e) {
//				String num=number.getText();
//				String pass=password.getText();
//				logDao.findone(num,pass);
//				if (logDao.findone(num, pass)==0) {
//					System.out.println("登录失败");
//				}else {
//					System.out.println("登录成功");
					Manager window1=new Manager();
//					TestForm tf=new TestForm();
//					tf.setVisible(true);
					window1.setSize(800, 500);
					window1.setLocationRelativeTo(null);
					window1.setVisible(true);
					frame.setVisible(false);  
					
				            
				        
				
//				}
					
			}
		});
		button.setBounds(400, 563, 219, 52);
		frame.getContentPane().add(button);
		ImageIcon img=new ImageIcon("E:\\用户登录.png");
		JPanel jp= (JPanel)frame.getContentPane();
		jp.setOpaque(false);
		frame.getContentPane().setLayout(null);
		JLabel bg=new JLabel(img);
		bg.setBounds(0, 0, 1000, 700);
		frame.getLayeredPane().add(bg, new Integer(Integer.MIN_VALUE));
		jp.add(bg);
	}

}
